/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import java.util.ArrayList;

/**
 *
 * @author sbavdhorst
 */
public class Analysis {
    
    public static ArrayList[] getPairs(int size, ArrayList<Quartet> quartets){
        char[] alphabet = DenseSetGenerator.generateAlphabet(size);

        ArrayList<Character> char1 = new ArrayList<>();
        ArrayList<Character> char2 = new ArrayList<>();
        ArrayList<Double> number = new ArrayList<>();
        
        for(int i = 0; i<alphabet.length-1; i++){
            for(int j = i+1; j<alphabet.length; j++){
                char1.add(alphabet[i]);
                char2.add(alphabet[j]);
                
                double seen = 0, total = 0;
                for(Quartet q: quartets){
                    if(q.contains(alphabet[i]) && q.contains(alphabet[j])){
                        total++;
                        if(q.containsPair(alphabet[i], alphabet[j]))
                            seen++;
                    }
                }
                number.add(seen/total);
            }    
        }

        return new ArrayList[]{char1, char2, number};
    }
}
